<template>
  <div id="app" class="User">
    <div class="client" v-if="show">
      <router-view name="client" v-if="isrouter"></router-view>
    </div>
<div class="Admin" v-if="!show" >
<router-view name="msglogins" :key="key" ></router-view>
<router-view name="adminin" :key="key"></router-view></div>

  </div> 
</template>

<script>
// import Login from "./components/page/admin/login";
export default {
  name: 'App',
  provide()
  {
    return{
      reload:this.reload
    }
  },
  data () {
    return {
      show:true,
      isrouter:true
    }
  },
  mounted () {
    // console.log("更新了？")
    // console.log("route",this.$route);
    // console.log("router",this.$router);
    let str=JSON.parse(JSON.stringify(this.$route.path));
    let path=str.slice(0,6);
    // console.log()
    // console.log(this.$route.path==="/admin");
    if(path==="/admin")
      {
        this.show=false;
      }
      else{
        this.show=true;
      }
  
  },
  // components:{
  //   Login
  // },
  computed: {
    key(){
	        return this.$route.path + Math.random();
	    }
  },
  methods: {
  reload()
  {
    this.isrouter=false;
    this.$nextTick(()=>
    {
      this.isrouter=true
    })
  }
  }

}
</script>

<style>
#app,.User,.Admin,.client{
  width: 100%;
  height: 100%;
}

</style>
